package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.CertificateType;

import java.util.Date;
import javax.validation.constraints.NotNull;

import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.EmpCertificateExample.E_COMPANY_ID;
import static org.jsola.hr.example.EmpCertificateExample.E_EMP_ID;
import static org.jsola.hr.example.EmpCertificateExample.E_END_TIME;
import static org.jsola.hr.example.EmpCertificateExample.E_LEVEL;
import static org.jsola.hr.example.EmpCertificateExample.E_NAME;
import static org.jsola.hr.example.EmpCertificateExample.E_NUMBER;
import static org.jsola.hr.example.EmpCertificateExample.E_REMARK;
import static org.jsola.hr.example.EmpCertificateExample.E_START_TIME;
import static org.jsola.hr.example.EmpCertificateExample.E_TYPE;
import static org.jsola.hr.example.EmpCertificateExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.EmpCertificateExample.M_EMP_ID_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_LEVEL_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_NAME_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_NUMBER_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_REMARK_MAX;
import static org.jsola.hr.example.EmpCertificateExample.M_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpCertificateExample.N_COMPANY_ID;
import static org.jsola.hr.example.EmpCertificateExample.N_EMP_ID;
import static org.jsola.hr.example.EmpCertificateExample.N_END_TIME;
import static org.jsola.hr.example.EmpCertificateExample.N_LEVEL;
import static org.jsola.hr.example.EmpCertificateExample.N_NAME;
import static org.jsola.hr.example.EmpCertificateExample.N_NUMBER;
import static org.jsola.hr.example.EmpCertificateExample.N_REMARK;
import static org.jsola.hr.example.EmpCertificateExample.N_START_TIME;
import static org.jsola.hr.example.EmpCertificateExample.N_TYPE;

/**
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【员工证书】的参数")
@Data
public class EmpCertificateUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_EMP_ID, example = E_EMP_ID)
    @Length(max = 32, message = M_EMP_ID_MAX)
    private String empId;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = CertificateType.VALUES_STR)
    @Const(constClass = CertificateType.class, message = M_TYPE_ENUM_NOT_MATCH)
    private Integer type;

    @ApiModelProperty(notes = N_NAME, example = E_NAME)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_LEVEL, example = E_LEVEL)
    @Length(max = 50, message = M_LEVEL_MAX)
    private String level;

    @ApiModelProperty(notes = N_NUMBER, example = E_NUMBER)
    @Length(max = 255, message = M_NUMBER_MAX)
    private String number;

    @ApiModelProperty(notes = N_START_TIME, example = E_START_TIME)
    private Date startTime;

    @ApiModelProperty(notes = N_END_TIME, example = E_END_TIME)
    private Date endTime;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 255, message = M_REMARK_MAX)
    private String remark;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;


}

